# -*- coding: UTF-8 -*-


import re

content = '    NSArray *chineseYears = [NSArray arrayWithObjects:LS(@"甲子"),(@"乙丑",@"丙寅",@"丁卯",@"戊辰",@"己巳",@"庚午",@"辛未",@"壬申",@"癸酉",@"甲戌",@"乙亥",@"丙子",@"丁丑",@"戊寅",@"己卯",@"庚辰",@"辛己",@"壬午",@"癸未",@"甲申",@"乙酉",@"丙戌",@"丁亥",@"戊子",@"己丑",@"庚寅",@"辛卯",@"壬辰",@"癸巳",@"甲午",@"乙未",@"丙申",@"丁酉",@"戊戌",@"己亥",@"庚子",@"辛丑",@"壬寅",@"癸丑",@"甲辰",@"乙巳",@"丙午",@"丁未",@"戊申",@"己酉",@"庚戌",@"辛亥",@"壬子",@"癸丑",@"甲寅",@"乙卯",@"丙辰",@"丁巳",@"戊午",@"己未",@"庚申",@"辛酉",@"壬戌",@"癸亥", nil];'

# print content

# matchObj = re.match(r'@"[^"]*[\u4E00-\u9FA5]+[^"\n]*?"',content)
# @"[^"]*[\u4E00-\u9FA5]+[^"\n]*?"

# pat = re.compile(r'@"[^"]*[\u4E00-\u9FA5]+[^"\n]*?"')
# str1='hjggj小vjjk明'
# pat=re.compile(r'[\u4e00-\u9fa5]+')
# result=pat.findall(str1)
# print(result)
# @"[^"]*[\u4E00-\u9FA5]+[^"\n]*?"

# str = content.decode('utf-8')
# pat = u'(@"[^"]*[\u4E00-\u9FA5]+[^"\n]*?")'
# results = re.findall(pat,str)
# for s in results:
#     sn_str = s.encode('utf-8')
#     # print sn_str
#     new_sn_str = 'LS(%s)'%(sn_str)

#     content = content.replace(new_sn_str,sn_str)
#     content = content.replace(sn_str,new_sn_str)

#     sn_str = sn_str[2:-1]
    
#     print '"%s" = "%s";' % (sn_str,sn_str)


# print content





# txt='- (void)startToReadBook:(KXSBook *)book'

# re1='.*?'	# Non-greedy match on filler
# re2='((?:[a-z][a-z]+))'	# Word 1

# rg = re.compile(re1+re2,re.IGNORECASE|re.DOTALL)
# m = rg.search(txt)
# if m:
#     word1=m.group(1)
#     print "("+word1+")"+"\n"

    
# contentNew = re.sub(pat,)

# str.encode('utf-8')
# xx=u'([/u4e00-/u9fa5]+)'
# results = re.findall(xx,str2)
# print(results)


# str1='hjggj小vjjk明'
# pat=re.compile(r'[\u4e00-\u9fa5]+')
# result=pat.findall(str1)
# print(result)

file_str = '#import "KXSBaseObject.h"  Object.h"   Object.h"   KXSBaseObject1  KXSBaseObject  '

oldName = 'KXSBaseObject'
newName = 'KXSBaseConObject'

 
pattern = '\\b(%s)\\b' % oldName
print pattern
file_str = re.sub(pattern,newName,file_str)

print file_str 


